////////////////////////////////////////////////////////////////////////////////
//      
//      Kingsoft File for shp routines file
//      
//      File      : she_draw.h
//      Comment   : simple html parser draw class
//					
//      Create at : 2012-12-07 10:17:25
//      Create by : chenguicheng
//      
////////////////////////////////////////////////////////////////////////////////

#pragma once
#include "shp_misc.h"
#include <math.h>

#include "res/shp_path.h"

#ifdef SHP_USE_GDIPLUS
#include <GdiPlus.h>
#pragma comment(lib, "gdiplus.lib")

using namespace Gdiplus;
#define shpfont				Font*
#define shpdc				Graphics
#define shpimg				Image*


#else

#define shpfont				HFONT
#define shpdc				CDCHandle
#define shpimg				HBITMAP

#endif


namespace shp_draw
{
	void frame_rect( shpdc& dc, CRect& rect, shpclr clr_border, int nAlpha );
	void fill_rect( shpdc& dc, CRect& rect, shpclr clr_bg, int nAlpha );
	void draw_text( shpdc& dc, shpstr& str_text, CRect& rect, UINT u_fmt, shpfont font, shpclr& clr_text, bool b_calc = false );

	shpfont create_new_font( BOOL b_bold, BOOL b_underline, BOOL b_italic, int n_size, shpstr& str_font );
	void destroy_font( shpfont font );
	void redraw_rect( HWND h_wnd, CRect& rect );
	void destroy_img( shpimg& img );
	shpimg load_img( shpstr& str_img );
	CSize& get_img_size( shpimg img );
	void draw_bmp( shpdc& dc, shpimg img, CRect& rc_bmp, CRect rc_draw, int i_alpha );
	void draw_bmp( shpdc& dc, shpimg img, CRect& rc_bmp, int x_dest, int y_dest, int i_alpha );


}